package com.ext.aic.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.ext.aic.fragment.AISeparateFragment;
import com.ext.aic.fragment.ContentCenterFragment;
import com.ext.aic.fragment.GettingCustomersFragment;
import com.ext.aic.fragment.MineFragment;

public class MainViewPagerAdapter extends FragmentStateAdapter {

    public MainViewPagerAdapter(FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @Override
    public Fragment createFragment(int position) {
        if (position == 1) {
            return new AISeparateFragment();
        } else if (position == 2) {
            return new GettingCustomersFragment();
        } else if (position == 3) {
            return new MineFragment();
        }
        return new ContentCenterFragment();
    }

    @Override
    public int getItemCount() {
        return 4;
    }
}
